home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / cpp.z / cpp
Encoding:
Text File  |  2002-10-03  |  12.5 KB  |  213 lines

  1. CPP(1)                                                Last changed: 4-27-99
  2.  
  3.  
  4. NNAAMMEE
  5.      ccpppp - C language preprocessor
  6.  
  7. SSYYNNOOPPSSIISS
  8.      LLIIBBDDIIRR//ccpppp [[ _o_p_t_i_o_n || _f_i_l_e ]] ......
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      IRIX systems
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      ccpppp is a K&R C language preprocessor (not an ISO/ANSI C language
  15.      preprocessor) designed for standalone use and to be invoked as the
  16.      first pass of all Fortran compilations and any K&R mode C compilation
  17.      with the --mmpp option.  Thus, the output of ccpppp is designed to be in a
  18.      form acceptable as input to the next pass of the C compiler.
  19.      Standalone use of ccpppp on C code is not recommended, because the
  20.      functionality of ccpppp has been incorporated into the C compiler.  See
  21.      the mm44(1) man page for information on a more general macro processor.
  22.  
  23.      The ccpppp preprocessor does not recognize the ## operator (sometimes
  24.      called the stringize operator), the #### operator (sometimes called the
  25.      pasting operator), and the ##eelliiff command.  There are other differences
  26.      between this and ISO/ANSI C preprocessors.
  27.  
  28.      ccpppp optionally accepts any sequence of flags and input file names.
  29.      The input files are processed in order; if no input file names are
  30.      given, the standard input is used.  The results of preprocessing the
  31.      input file(s) are sent to the standard output.
  32.  
  33.      The following options are accepted by ccpppp:
  34.  
  35.      --PP      Preprocess the input without producing the line control
  36.              information used by the next pass of the C compiler.
  37.  
  38.      --CC      By default, ccpppp strips C-style comments.  If the --CC option is
  39.              specified, all comments (except those found on ccpppp directive
  40.              lines) are passed along.
  41.  
  42.      --MM      Run only the macro preprocessor on the named C programs,
  43.              requesting it to generate Makefile dependencies, and send the
  44.              results to the standard output.
  45.  
  46.      --MMDDuuppddaattee _f_i_l_e_n_a_m_e
  47.              Similar to the --MM option, but stores the resulting Makefile
  48.              dependencies in _f_i_l_e_n_a_m_e rather than sending them to the
  49.              standard output.  ccpppp specified with the --MMDDuuppddaattee option
  50.              updates only the lines in _f_i_l_e_n_a_m_e that end with a distinctive
  51.              make comment and begin with the target name (as described
  52.              under the --MMDDttaarrggeett option) followed by a colon.
  53.  
  54.      --MMDDttaarrggeett _n_a_m_e
  55.              When the --MMDDuuppddaattee option has been specified, this option
  56.              causes _n_a_m_e to be used as the target name for the first source
  57.              file.  By default, the target name for a source file is the
  58.              same as the source file name with a ..oo suffix.
  59.  
  60.      --UU_n_a_m_e  Remove any initial definition of _n_a_m_e, where _n_a_m_e is a
  61.              reserved symbol that is predefined by the particular
  62.              preprocessor.  Following is the current list of these possibly
  63.              reserved symbols.  ccpppp predefines the ____EEDDGG, ssggii, uunniixx, and
  64.              mmiippss symbols.  The ____EEXXTTEENNSSIIOONNSS____ symbol is predefined to
  65.              indicate this is not an ANSI ccpppp and to allow extensions in
  66.              ANSI C include files.  The compiler drivers, aass(1), cccc(1),
  67.              CCCC(1), ppcc(1), and ff7777(1) predefine many other symbols during
  68.              preprocessing.
  69.  
  70.      See their respective man pages for complete lists of the symbols that
  71.      they define.
  72.      --DD_n_a_m_e
  73.      --DD_n_a_m_e=_d_e_f
  74.           Define _n_a_m_e with value _d_e_f as if by a ##ddeeffiinnee.  If no =_d_e_f is
  75.           given, _n_a_m_e is defined with value 1.  The --DD option has lower
  76.           precedence than the --UU option.  That is, if the same name is used
  77.           in both a --UU options and a --DD option, the name will be undefined
  78.           regardless of the order of the options.
  79.  
  80.      --II_d_i_r
  81.           Change the algorithm for searching for ##iinncclluuddee files whose names
  82.           do not begin with // to look in _d_i_r before looking in the
  83.           directories on the standard list.  Thus, ##iinncclluuddee files whose
  84.           names are enclosed in double quotation marks ("") will be
  85.           searched for first in the directory of the file with the ##iinncclluuddee
  86.           line, then in the directories named in --II options, and last in
  87.           directories on a standard list.  For ##iinncclluuddee files whose names
  88.           are enclosed in <>, the directory of the file with the ##iinncclluuddee
  89.           line is not searched.  If --II is specified with no _d_i_r, ccpppp is
  90.           instructed to suppress the search of the standard list of include
  91.           directories.  This standard list consists only of //uussrr//iinncclluuddee.
  92.  
  93.      --mmaaxx__rreecc__ddeepptthh==_n_u_m
  94.           Set the maximum nesting depth of calls to a single macro to _n_u_m.
  95.           The default value is 300.
  96.  
  97.      Four special names are understood by ccpppp.  The name ____LLIINNEE____ is
  98.      defined as the current line number (as a decimal integer) as known by
  99.      ccpppp, ____FFIILLEE____ is defined as the current file name (as a C string) as
  100.      known by ccpppp, ____DDAATTEE____ is defined as a C string containing the current
  101.      date (printed in the form "Dec 31 1999"), and ____TTIIMMEE____ is defined as a
  102.      C string containing the current time in hh:mm:ss format.  They can be
  103.      used anywhere (including in macros) just as any other defined name.
  104.  
  105.      All ccpppp directive lines start with ## in column 1.  Any number of
  106.      blanks and tabs are allowed between the ## and the directive. The
  107.      directives are:
  108.  
  109.      ##ddeeffiinnee _n_a_m_e _t_o_k_e_n-_s_t_r_i_n_g
  110.           Replace subsequent instances of _n_a_m_e with _t_o_k_e_n-_s_t_r_i_n_g.
  111.  
  112.      ##ddeeffiinnee _n_a_m_e(( _a_r_g, ..., _a_r_g ) ttookkeenn--ssttrriinngg
  113.           Note that there can be no space between _n_a_m_e and the (.  Replace
  114.           subsequent instances of _n_a_m_e followed by a (, a list of comma-
  115.           separated sets of tokens, and a ) followed by _t_o_k_e_n-_s_t_r_i_n_g, where
  116.           each occurrence of an _a_r_g in the _t_o_k_e_n-_s_t_r_i_n_g is replaced by the
  117.           corresponding set of tokens in the comma-separated list.  When a
  118.           macro with arguments is expanded, the arguments are placed into
  119.           the expanded _t_o_k_e_n-_s_t_r_i_n_g unchanged.  After the entire _t_o_k_e_n-
  120.           _s_t_r_i_n_g has been expanded, ccpppp restarts its scan for names to
  121.           expand at the beginning of the newly created _t_o_k_e_n-_s_t_r_i_n_g.
  122.  
  123.      ##uunnddeeff _n_a_m_e
  124.           Cause the definition of _n_a_m_e (if any) to be forgotten from now
  125.           on.  No additional tokens are permitted on the directive line
  126.           after _n_a_m_e.
  127.  
  128.      ##iiddeenntt "_s_t_r_i_n_g"
  129.           The _s_t_r_i_n_g and the directive are silently swallowed.
  130.  
  131.      No output is produced for this directive.
  132.  
  133.      ##pprraaggmmaa
  134.           The directive and whatever follows it on the line is passed to
  135.           the output in a slightly modified form which is not documented.
  136.           The form may change in a future release.
  137.  
  138.      ##pprraaggmmaa oonnccee
  139.           If this directive appears in an included file, the file will
  140.           never be included again, even if there is another ##iinncclluuddee of
  141.           this file.  No tokens or comments are permitted after the oonnccee
  142.           keyword.  Using ##pprraaggmmaa oonnccee is more efficient than using macro
  143.           wrappers, because the included file is not rescanned, however, it
  144.           may not be portable to third-party preprocessors.
  145.  
  146.      ##iinncclluuddee "_f_i_l_e_n_a_m_e"
  147.  
  148.      ##iinncclluuddee <_f_i_l_e_n_a_m_e>
  149.           Include, at this point, the contents of _f_i_l_e_n_a_m_e (which will then
  150.           be run through ccpppp).  When the <_f_i_l_e_n_a_m_e> notation is used,
  151.           _f_i_l_e_n_a_m_e is only searched for in the standard places.  See the --II
  152.           option above for more detail.  No additional tokens are permitted
  153.           on the directive line after the final "" or >>.
  154.  
  155.      ##lliinnee _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t "_f_i_l_e_n_a_m_e"
  156.           Causes ccpppp to generate line control information for the next pass
  157.           of the C compiler.  _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t is the line number of the
  158.           next line and _f_i_l_e_n_a_m_e is the file from which it comes.  If
  159.           "_f_i_l_e_n_a_m_e" is not given, the current file name is unchanged.  No
  160.           additional tokens are allowed on the directive line after the
  161.           optional _f_i_l_e_n_a_m_e.
  162.  
  163.      ##eennddiiff
  164.           Ends a section of lines begun by a test directive (##iiff, ##iiffddeeff,
  165.           or ##iiffnnddeeff).  Each test directive must have a matching ##eennddiiff.
  166.           No additional tokens are permitted on the directive line.
  167.  
  168.      ##iiffddeeff _n_a_m_e
  169.           The lines following this directive will appear in the output only
  170.           if _n_a_m_e has been the subject of a previous ##ddeeffiinnee without being
  171.           the subject of an intervening ##uunnddeeff.  No additional tokens are
  172.           permitted on the directive line following _n_a_m_e.
  173.  
  174.      ##iiffnnddeeff _n_a_m_e
  175.           The lines following this directive will appear in the output only
  176.           if _n_a_m_e has not been the subject of a previous ##ddeeffiinnee.  No
  177.           additional tokens are permitted on the directive line after _n_a_m_e.
  178.  
  179.      ##iiff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  180.           Lines following this directive will appear in the output only if
  181.           the _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n evaluates to non-zero.  All binary non-
  182.           assignment C operators, the ?: operator, the unary -, !, and ~
  183.           operators are legal in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  The precedence of
  184.           the operators is the same as defined by the C language.  There is
  185.           also a unary operator ddeeffiinneedd, which can be used in _c_o_n_s_t_a_n_t-
  186.           _e_x_p_r_e_s_s_i_o_n in the following two forms: ddeeffiinneedd (( _n_a_m_e )) _o_r
  187.           ddeeffiinneedd _n_a_m_e..  TThhiiss aalllloowwss tthhee uuttiilliittyy ooff ##iiffddeeff aanndd ##iiffnnddeeff iinn aa
  188.           ##iiff ddiirreeccttiivvee..  OOnnllyy tthheessee ooppeerraattoorrss,, iinntteeggeerr ccoonnssttaannttss,, aanndd
  189.           nnaammeess wwhhiicchh aarree kknnoowwnn bbyy ccpppp sshhoouulldd bbee uusseedd iinn _c_o_n_s_t_a_n_t-
  190.           _e_x_p_r_e_s_s_i_o_n..  TThhee ssiizzeeooff ooppeerraattoorr iiss nnoott aavvaaiillaabbllee..
  191.  
  192.           TToo tteesstt wwhheetthheerr eeiitthheerr ooff ttwwoo ssyymmbboollss,, _f_o_o aanndd _f_u_m,, aarree ddeeffiinneedd,,
  193.           uussee tthhee ffoolllloowwiinngg::
  194.  
  195.                #if defined(foo) || defined(fum)
  196.  
  197.      ##eellssee
  198.           The lines following this directive will appear in the output only
  199.           if the preceding test directive evaluates to zero.  No additional
  200.           tokens are permitted on the directive line.
  201.  
  202.      The test directives and the possible ##eellssee directives can be nested.
  203.  
  204. FFIILLEESS
  205.      _I_N_C_D_I_R    Standard directory list for ##iinncclluuddee files, //uussrr//iinncclluuddee
  206.  
  207.      _L_I_B_D_I_R    //uussrr//lliibb
  208.  
  209. SSEEEE AALLSSOO
  210.      cccc(1), lliinnee(1), mm44(1), uunniiffddeeff(1)
  211.  
  212.      This man page is available only online.
  213.